<template>
  <div class="pre-screening-results">
    <div class="resultsStatus">
      <van-icon v-if="type == '' || type == undefined" name="checked"/>
      <van-icon v-if="type == 'refuse'" name="clear"/>
      <!-- <p class="title" v-if="type == '' || type == undefined">还款成功</p>
      <p class="title" v-if="type == 'refuse'">还款失败</p> -->
      <p class="title">{{results}}</p>
      <p class="refuseTip" v-if="write">{{write}}</p>
    </div>
    <div class="btn-group">
      <div class="btn">
        <router-link :to="{ path:'/loanPage/newHome' }">返回首页</router-link>
      </div>
      <div class="btn btn-primary" v-if="source != 'intent' && (type == '' || type == undefined)">
        <router-link :to="{ path:'/loanPage/newHome' }">立即用款</router-link>
      </div>
      <div class="btn btn-primary" v-if="source != 'intent' && type == 'refuse'">
        <router-link :to="{ path:'/loanPage/repaymentHome' }">重新还款</router-link>
      </div>
    </div>
  </div>
</template>

<script>
/**
 * <repaymentStatus :type="'refuse'" results="还款失败" :write="'文字'"></repaymentStatus>
 * type:  1.不传值表示 通过  2.传refuse值表示 不通过
 * source: 来源  默认还款  传intent客户意向登记
 * results: 成功失败title
 */
export default {
  name: "repaymentStatus",
  props: ['type', 'write', 'source', 'results']
}
</script>

<style scoped lang="less">
.content_box {
  margin: 5.8rem 0rem 0rem 0rem;
}

.pre-screening-results {
  font-size: 1.3rem;
  line-height: 2rem;
  font-family: PingFang SC-Regular, PingFang SC;
  font-weight: 400;
  color: rgb(134, 144, 156);
  background-color: #FFFFFF;
  height: calc(100vh - 5.8rem);
  position: relative;
}

.pre-screening-results .resultsStatus {
  padding: 4rem;
  text-align: center;
}

.pre-screening-results .refuseTip {
  text-align: left;
}

.pre-screening-results .van-icon-clear {
  color: rgb(254, 93, 61) !important;
  font-size: 6rem;
}

.pre-screening-results .van-icon-checked {
  color: rgb(97, 210, 67) !important;
  font-size: 6rem;
}

.pre-screening-results .title {
  font-size: 2rem;
  color: rgb(78, 89, 105);
  margin: 1.6rem;
}

.pre-screening-results .btn-group {
  display: flex;
  justify-content: center;
}

.pre-screening-results .btn {
  width: 30%;
  padding: 6px 0;
  font-size: 1.4rem;
  font-weight: 400;
  text-align: center;
  border-radius: 4.4rem;
  margin: 0 0.8rem;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.pre-screening-results .btn a {
  color: var(--primary-color);
}

.pre-screening-results .btn-primary {
  color: #ffffff;
  border: 1px solid var(--primary-color);
  background: var(--primary-color);
}

.pre-screening-results .btn-primary a {
  color: #ffffff;
}
</style>
